<?php

if ($find_item[parts_left] < $find_item2[parts])
{
die("
	<br><center>
	<table width=380 cellspacing=0>
	<tr>
	<td bgcolor=$tableOutline>
	<center><b>Selected Item</b></center>
	</td>
	<td width=300 bgcolor=$tableOutline>
	<center><b>Item Details</b></center>
	</td>
	</tr>
	<tr height=100>
	<td valign=middle>
	<p align=center><img src=images/user_images/opg_$game/items/item_$find_item2[id].gif>
	<br>
	<b>$find_item2[item_name]</b>
	</td>
	<td width=300>
	<p align=center>Sorry, your $find_item2[item_name] could not be donated because it has already been used.<br><a href=myitems.php?game=$game>Back to your items.</a></p>
	</td>
	</tr>
	</table>
	</center>
");
}

mysql_query("DELETE FROM usersitems2 WHERE id = '$id' AND owner = '$userid' AND game = '$game'");
mysql_query("INSERT INTO penny_store2 (item_id,donated_by,game) VALUES ('$find_item2[id]','$userid','$game')");

print "
		<br><center>
		<table width=380 cellspacing=0>
		<tr>
		<td bgcolor=$topAndBottomBG>
		<center><b><font color=$topAndBottomText>Selected Item</font></b></center>
		</td>
		<td width=300 bgcolor=$topAndBottomBG>
		<center><b><font color=$topAndBottomText>Item Details</font></b></center>
		</td>
		</tr>
		<tr height=100>
		<td valign=middle>
		<p align=center><img src=images/user_images/opg_$game/items/item_$find_item2[id].gif>
		<br>
		<b>$find_item2[item_name]</b>
		</td>
		<td width=300>
		<p align=center>You have donated your $find_item2[item_name].<br><a href=myitems.php?game=$game>Back to your items.</a></p>
		</td>
		</tr>
		</table>
		</center>
";

?>